package internationalenergytradingplatform.dao;

import com.github.pagehelper.Page;
import internationalenergytradingplatform.dto.ClassificationPageQueryDTO;
import internationalenergytradingplatform.pojo.Classification;
import org.apache.ibatis.annotations.*;

@Mapper
public interface ClassificationMapper {
    Page<Classification> ClassificationPageQuery(ClassificationPageQueryDTO classificationPageQueryDTO);

    @Insert("insert into commodity_classification values(null, #{name}, #{explain}, #{accountr})")
    void addClassfication(Classification classification);

    @Update("update commodity_classification set name = #{name}, `explain` = #{explain} where id = #{id}")
    void modifyClassification(Classification classification);

    @Select("select * from commodity_classification where id = #{id}")
    Classification getClassificationById(Integer id);

    @Delete("delete from commodity_classification where id=#{id}")
    void deleteClassificationById(Integer id);
}
